import {post,fetch,del} from './http'

// 首页轮播
export const swiperImg = function (data) {
    return new Promise((resolve, reject) => {
        post('/flower-server/flower/swiper', data).then(res =>{
            resolve(res)
        }).catch(err => {
            reject(err)
        })
    })
}

// 鲜花分页接口
export const getFlowerList = function (data) {
    return new Promise((resolve, reject) => {
        post('/flower-server/flower/query', data).then(res =>{
            resolve(res)
        }).catch(err => {
            reject(err)
        })
    })
}
// 修改
export const flowerUpdate = function (data) {
    return new Promise((resolve, reject) => {
        post('/flower-server/flower/update', data).then(res =>{
            resolve(res)
        }).catch(err => {
            reject(err)
        })
    })
}
// 创建
export const flowerCreate = function (data) {
    return new Promise((resolve, reject) => {
        post('/flower-server/flower/create', data).then(res =>{
            resolve(res)
        }).catch(err => {
            reject(err)
        })
    })
}
// 批量删除
export const delFlowerBatch = function (data) {
    return new Promise((resolve, reject) => {
        del('/flower-server/flower/delete/list', data).then(res =>{
            resolve(res)
        }).catch(err => {
            reject(err)
        })
    })
}
// 根据获取
export const getFlowerById = function (data) {
    return new Promise((resolve, reject) => {
        fetch('/flower-server/flower/'+ data).then(res =>{
            resolve(res)
        }).catch(err => {
            reject(err)
        })
    })
}
// 删除
export const delFlowerById = function (data) {
    return new Promise((resolve, reject) => {
        del('/flower-server/flower/delete/'+ data).then(res =>{
            resolve(res)
        }).catch(err => {
            reject(err)
        })
    })
}
